from .gui.form.header import SimpleHeader
from .gui.list.textitem import BasicTextItem
from .gui import listscreen
import autoplay
import podcasts

id = "main menu"

def Create(app, current_song):
  header_cb = lambda screen: SimpleHeader(screen, "Main Menu",[])
  screen, main_menu = listscreen.CreateListScreen(app, header_cb)
  autoplay_screen = autoplay.AutoPlayScreen(app, current_song)

  main_menu.AddItem(BasicTextItem(
    app,
    "Auto play",
    lambda: autoplay_screen.AutoPlay()))

  main_menu.AddItem(BasicTextItem(app,
    "Podcasts",
    lambda: podcasts.ShowPodcasts(app, main_menu, current_song),
    is_submenu=True))

  #main_menu.AddItem(TextItemToSubmenu(app, "Settings", "settings"))

  app.AddScreen(id, screen)
